<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<div class="gv-page-container">
  <a [routerLink]="['..']" class="gv-back-link"><small><< Back to groups</small></a>
  <h1>New Group</h1>
  <div>
    <form (ngSubmit)="create()" #groupForm="ngForm" fxLayout="column" fxFlex="70">
      <div class="gv-form-section">
        <mat-form-field appearance="outline" floatLabel="always">
          <mat-label>Name</mat-label>
          <input matInput type="text" placeholder="Name" #name="ngModel" name="name" [(ngModel)]="group.name" required>
          <mat-hint>The name of the Group.</mat-hint>
          <mat-error *ngIf="name.errors?.required">Enter name</mat-error>
        </mat-form-field>
        <mat-form-field appearance="outline" floatLabel="always">
          <mat-label>Description</mat-label>
          <input matInput type="text" placeholder="Description" #name="ngModel" name="description" [(ngModel)]="group.description">
          <mat-hint>The description of the Group.</mat-hint>
        </mat-form-field>
      </div>
      <div fxLayout="row" fxLayoutAlign="end">
        <a mat-button [routerLink]="['..']" style="margin-right: 20px;">CANCEL</a>
        <button mat-raised-button [disabled]="!groupForm.valid || groupForm.pristine" type="submit">CREATE</button>
      </div>
    </form>
    <div class="gv-page-description" fxFlex>
      <h3>Group ?</h3>
      <div class="gv-page-description-content">
        <p>
          Group resources are meant to enable expression of common
          group-based or role-based access control models.
        </p>
      </div>
    </div>
  </div>
</div>
